<?php
App::uses('AppModel', 'Model');
/**
 * Teacher Model
 *
 * @property Department $Department
 * @property Pozition $Pozition
 */
class Teacher extends AppModel {

/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'adlogin' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'mail' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'lastname' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'firstname' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'surname' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'impactfactor_middle' => array(
				'notEmpty' => array(
						'rule' => array('decimal', 3),
						'message' => 'Введите вещественное число вида 4.245 - разделитель ТОЧКА',
						'allowEmpty' => true,
						//'required' => false,
						//'last' => false, // Stop validation after this rule
						//'on' => 'create', // Limit validation to 'create' or 'update' operations
				),
		),
		'cit_count_5_years' => array(
				'notEmpty' => array(
						'rule' => array('naturalNumber'),
						'message' => 'Введите целое число',
						'allowEmpty' => true,
						//'required' => false,
						//'last' => false, // Stop validation after this rule
						//'on' => 'create', // Limit validation to 'create' or 'update' operations
				),
		),		
		'index_hirsh_116' => array(
				'notEmpty' => array(
						'rule' => array('naturalNumber'),
						'message' => 'Введите целое число',
						'allowEmpty' => true,
						//'required' => false,
						//'last' => false, // Stop validation after this rule
						//'on' => 'create', // Limit validation to 'create' or 'update' operations
				),
		),		
		'impactfactor_middle_117' => array(
				'notEmpty' => array(
						'rule' => array('decimal', 3),
						'message' => 'Введите вещественное число вида 4.245 - разделитель ТОЧКА',
						'allowEmpty' => true,
						//'required' => false,
						//'last' => false, // Stop validation after this rule
						//'on' => 'create', // Limit validation to 'create' or 'update' operations
				),
		),		
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed
//impactfactor_middle
/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'Department' => array(
			'className' => 'Department',
			'foreignKey' => 'department_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Pozition' => array(
			'className' => 'Pozition',
			'foreignKey' => 'pozition_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
